﻿using System.Drawing;
using ZeldoEngine;
using ZeldoEngineObjects;

namespace MapEditor
{
    public class AppParams
    {
        #region singleton
        private static AppParams _instance;

        public static AppParams GetIns()
        {
            if (_instance == null)
            {
                _instance = new AppParams();
            }

            return _instance;
        }
        #endregion

        /* Parametres du projet */
        public ProjectManager Project { get; set; }

        /* Outils de dessin */
        public enum Tools { Pencil }
        public enum Layer { Layer1, Layer2, Layer3, LayerEvent }

        public Tools CurrentTool { get; set; }
        public Layer CurrentLayer { get; set; }

        public int StartSelectedTile { get; set; }
        public int EndSelectedTile { get; set; }

        public Rectangle Selection { get; set; }

        public bool MapLoaded { get; set; }

        public AppParams()
        {
            this.CurrentTool = Tools.Pencil;
            this.CurrentLayer = Layer.Layer1;

            this.StartSelectedTile = 0;
            this.EndSelectedTile = 0;
            this.Selection = new Rectangle(0, 0, EngineConsts.TILE_SIZE, EngineConsts.TILE_SIZE);
            this.MapLoaded = false;
        }

        public void InitializeProject(string name, string path)
        {
            this.Project = new ProjectManager();
            this.Project.CreerProjet(name, path);
        }
    }
}
